<!--
  @author duanzuocai
  @since 2018/11/10 13:57
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<head th:include="common/common :: jscss">
    <title>新增或编辑分类</title>
</head>
<body>

<div class="layui-fluid">

    <blockquote class="layui-crumb">
        后台产品>
        <a lay-href="/brand/list.action">品牌管理</a>>
        <zmn th:text="${(brand.brandId == 0) ? '新增品牌' : brand.name}"</zmn>
    </blockquote>

    <div class="layui-card">
        <form method="post" action="" class="layui-form" lay-filter="zmn-brand-form">
            <input type="hidden" name="brandId" th:value="${brand.brandId}"/>

            <div class="layui-card-header" style="margin-top:10px;"><b>基本信息</b></div>
            <div class="layui-split">&nbsp;</div>

            <div class="layui-form-item" th:if="${brand.brandId > 0}">
                <label class="layui-form-label">品牌ID：</label>
                <div class="layui-input-block">
                    <div class="layui-form-mid">
                        <span th:text="${brand.brandId}">ID</span>
                        <span style="font-family:'ArialMT', 'Arial';color:#33AB9F;" th:text="${brand.status == 2 ? '正常' : '停用'}">status</span>
                    </div>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">品牌名称：</label>
                <div class="layui-input-inline" style="width:400px;">
                    <input type="text" name="name" lay-verify="required" th:value="${brand.name}" autocomplete="off" class="layui-input" maxlength="45"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">英文名称：</label>
                <div class="layui-input-inline" style="width:400px;">
                    <input type="text" name="enname" lay-verify="enname" th:value="${brand.enname}" autocomplete="off" class="layui-input" maxlength="45"/>
                </div>
                <span class="layui-form-mid layui-word-aux">请遵循品牌标识填写，注意大小写</span>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">品牌类型：</label>
                <div class="layui-input-inline">
                    <select name="type">
                        <option th:each="type:${types}" th:value="${type.key}" th:text="${type.value}" th:selected="${type.key == brand.type}">
                    </select>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">品牌icon：</label>
                <div class="layui-upload-drag" id="icon">
                    <input type="hidden" lay-verify="required" id="iconValue" name="icon">
                    <i class="layui-icon"></i>
                    <p>点击上传</p>
                </div>
                <div class="layui-inline" style="width: 200px;">
                    <i onclick="previewImg('iconValue')" class="layui-icon layui-icon-search btn-review"></i>
                    <br>
                    <i onclick="deleteImg('icon')"  class="layui-icon layui-icon-delete btn-del funcClass"></i>
                    <br>
                    <span style="color: #9F9F9F;">建议上传尺寸：216*100 px，png格式，小于1M,用于：前端品牌icon展示</span>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">品牌状态：</label>
                <div class="layui-input-inline">
                    <select name="status">
                        <option th:each="status:${statuses}" th:value="${status.key}" th:text="${status.value}" th:selected="${status.key == brand.status}">
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">排序号：</label>
                <div class="layui-input-inline" style="width:240px;">
                    <input type="text" name="sort" lay-verify="sort" th:value="${brand.sort}" autocomplete="off" class="layui-input" maxlength="6"/>
                </div>
                <div class="layui-form-mid layui-word-aux">越小越靠前</div>
            </div>

            <zmn th:if="${brand.brandId > 0}">
                <div class="layui-card-header"><b>其他信息</b></div>
                <div class="layui-split">&nbsp;</div>
                <div class="layui-form-item layui-form-item-xs">
                    <label class="layui-form-label">修改人/时间</label>
                    <div class="layui-input-block">
                        <div class="layui-form-mid layui-word-aux" th:text="${brand.updater} + '&nbsp;/&nbsp;' + ${#dates.format(brand.updateTime, 'yyyy-MM-dd HH:mm:ss')}">修改人/时间</div>
                    </div>
                </div>
                <div class="layui-form-item layui-form-item-xs">
                    <label class="layui-form-label">创建人/时间</label>
                    <div class="layui-input-block">
                        <div class="layui-form-mid layui-word-aux" th:text="${brand.creater} + '&nbsp;/&nbsp;' + ${#dates.format(brand.createTime, 'yyyy-MM-dd HH:mm:ss')}">创建人/时间</div>
                    </div>
                </div>
            </zmn>

            <div class="layui-split">&nbsp;</div>
            <div class="layui-form-item layui-layout-admin">
                <div class="layui-input-block">
                    <div class="layui-footer" style="left: 0;">
                        <button class="layui-btn" lay-submit="" lay-filter="zmn-brand-form-submit" th:if="${#authPermit.checkPermit('/brand/addEdit.action')}">保存</button>
                        <button class="layui-btn layui-btn-primary" onclick="parent.layui.element.tabDelete('layadmin-layout-tabs', window.location.pathname + window.location.search)">取消</button>
                    </div>
                </div>
            </div>

        </form>

    </div>

</div>

<script type="text/javascript" th:inline="javascript">
    var json = {
        brand:[[${brand}]]
    };

    layui.config({
        base: "/static/lay/"
    }).extend({
        index: "lib/index",
        art_brand_detail: "brand/zmn.art.brand.edit",
    }).use(['index', 'art_brand_detail']);

</script>
</body>
</html>